// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   TagObject.java

package com.java4less.rchart.tags;

import java.util.Hashtable;

public class TagObject
{

	public static String TAG_OBJECT = "OBJECT";
	public static String TAG_STRING = "STRING";
	public static String TAG_BACKSPACE = "BACK";
	public static String TAG_CR = "CR";
	public static String TAG_LF = "LF";
	public static String OBJ_IMAGE = "IMAGE";
	public static String OBJ_COLOR = "COLOR";
	public static String OBJ_FONT = "FONT";
	public static String OBJ_BACKGROUND = "BACKGROUND";
	public static String OBJ_BORDER = "BORDER";
	public static String OBJ_ROTATION = "ROTATION";
	public static String OBJ_POSITION = "POSITION";
	public static String OBJ_CLICKINFO = "CLICKINFO";
	public static String OBJ_ALIGN = "ALIGN";
	public static String OBJ_NAME = "NAME";
	public static String OBJ_SIZE = "SIZE";
	public static String OBJ_ANCHOR = "ANCHOR";
	public static String OBJ_TIP = "TIP";
	public static String OBJ_MARGIN = "MARGIN";
	public static String ATT_TYPE = "TYPE";
	public static String ATT_OBJECT_NAME = "NAME";
	public static String ATT_VALUE = "VALUE";
	Hashtable attributes;

	public TagObject(String type)
	{
		attributes = new Hashtable();
		setAttribute(ATT_TYPE, type);
	}

	public TagObject(String type, String value)
	{
		attributes = new Hashtable();
		setAttribute(ATT_TYPE, type);
		setAttribute(ATT_VALUE, value);
	}

	public void setAttribute(String name, String value)
	{
		if (value == null)
		{
			return;
		} else
		{
			attributes.put(name, value);
			return;
		}
	}

	public String getAttribute(String name)
	{
		if (!attributes.containsKey(name))
			return "";
		else
			return (String)attributes.get(name);
	}

	public String getType()
	{
		return getAttribute(ATT_TYPE);
	}

	public String getName()
	{
		return getAttribute(ATT_OBJECT_NAME);
	}

	public String getValue()
	{
		return getAttribute(ATT_VALUE);
	}

	public boolean compareAtt(String attribute, String value)
	{
		return getAttribute(attribute).toLowerCase().equals(value.toLowerCase());
	}

}
